import javacc.MiniJavaParser;
import syntaxtree.Program;
import visitor.PrettyPrintVisitor;
import visitor.SymbolTableVisitor;
import visitor.TypeCheckingVisitor;

import symboltable.SymbolTable;

import frame.*;
import utils.*;
import temp.*;

public class main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		/*try{
			String program_code;
			if (args.length == 0) {
				program_code = 	"class Factorial {\n"
									+"public static void main(String[] a) {\n"
									+"System.out.println(new Fac().ComputeFac(10)); }\n"
									+"}\n"
									+"class Fac {\n"
									+		"public int ComputeFac(int num) { \n"
									+			"int num_aux;\n"
									+			"int a;\n a = false;\n"
									+			"if (num < 1)\n"
									+				"num_aux = 1;\n"
									+			"else\n"
									+				"num_aux = num * (this.ComputeFac(num-1));\n"
									+			"return num_aux;\n"
									+		"}\n"
									+"}\n";
			} else {
				program_code = args[0];
			}
			
			new MiniJavaParser(new java.io.StringReader(program_code));
			Program p = MiniJavaParser.Program();
			PrettyPrintVisitor v = new PrettyPrintVisitor();
			p.accept(v);
			
			SymbolTable symbol_table = new SymbolTableVisitor().build_table(p);
			
			TypeCheckingVisitor tc_visitor = new TypeCheckingVisitor();
			tc_visitor.perform_type_checking(p, symbol_table);
			
			System.out.println("Syntax is okay");
		} catch (Throwable e){
			System.out.println("Syntax check failed: " + e.getMessage());
		}*/
		MipsFrame frame = new MipsFrame();
		frame.newFrame(new Label("g"), new BoolList(true,null));
		
	}

}
